package com.sqfw.project.wp.domain;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.sqfw.project.system.domain.SysDept;
import com.sqfw.project.system.domain.SysMenu;

import java.io.Serializable;
import java.util.List;
import java.util.stream.Collectors;

/**
 * Treeselect树结构实体类
 * 
 * @author ruoyi
 */
public class WpTreeSelect implements Serializable
{
    private static final long serialVersionUID = 1L;

    /** 节点ID */
    private Long value;

    /** 节点名称 */
    private String label;

    private String fiveMajorModules;

    private String classType;

    /** 子节点 */
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<WpTreeSelect> children;

    public WpTreeSelect()
    {

    }

    public WpTreeSelect(SysCode sysCode)
    {
        this.value = sysCode.getAutoId();
        this.label = sysCode.getNodename();
        this.classType = sysCode.getNodetype();
        this.fiveMajorModules = sysCode.getFiveMajorModules();
        this.children = sysCode.getChildren().stream().map(WpTreeSelect::new).collect(Collectors.toList());
    }

    public WpTreeSelect(SysStruBak sysStruBak)
    {
        this.value = sysStruBak.getAutoId();
        this.label = sysStruBak.getStruName();
        this.children = sysStruBak.getChildren().stream().map(WpTreeSelect::new).collect(Collectors.toList());
    }
    public WpTreeSelect(SysDept dept)
    {
        this.value = dept.getDeptId();
        this.label = dept.getDeptName();
        this.children = dept.getChildren().stream().map(WpTreeSelect::new).collect(Collectors.toList());
    }
    public Long getValue()
    {
        return value;
    }

    public void setValue(Long value)
    {
        this.value = value;
    }

    public String getLabel()
    {
        return label;
    }

    public void setLabel(String label)
    {
        this.label = label;
    }

    public String getClassType() {
        return classType;
    }

    public void setClassType(String classType) {
        this.classType = classType;
    }

    public String getFiveMajorModules() {
        return fiveMajorModules;
    }

    public void setFiveMajorModules(String fiveMajorModules) {
        this.fiveMajorModules = fiveMajorModules;
    }

    public List<WpTreeSelect> getChildren()
    {
        return children;
    }

    public void setChildren(List<WpTreeSelect> children)
    {
        this.children = children;
    }
}
